scalar vs table valued function